<?php
require_once '../config.php';
require_once $lib_path.'FBMethod.php';
$fb = new FBMethod();
$access_token = $fb->getAccessToken("wing721208@gmail.com",$likes_client_id);

$ch = curl_init();
$params = '?access_token='.$access_token;        
curl_setopt($ch, CURLOPT_URL, $likes_url.$params);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
$result = curl_exec($ch);
$headers = curl_getinfo($ch);
curl_close($ch);
        
$result_decoded = json_decode($result, true);
//echo "<pre>";print_r($result_decoded);echo "</pre>";exit;
$handle = fopen($like_cache_path, "w+");
fwrite($handle,serialize($result_decoded['data']));
fclose($handle);
?>